# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.IdentityToolkit.V3.Model.IdentitytoolkitRelyingpartyUploadAccountRequest do
  @moduledoc """
  Request to upload user account in batch.

  ## Attributes

  *   `allowOverwrite` (*type:* `boolean()`, *default:* `nil`) - Whether allow overwrite existing account when user local_id exists.
  *   `blockSize` (*type:* `integer()`, *default:* `nil`) - 
  *   `cpuMemCost` (*type:* `integer()`, *default:* `nil`) - The following 4 fields are for standard scrypt algorithm.
  *   `delegatedProjectNumber` (*type:* `String.t`, *default:* `nil`) - GCP project number of the requesting delegated app. Currently only intended for Firebase V1 migration.
  *   `dkLen` (*type:* `integer()`, *default:* `nil`) - 
  *   `hashAlgorithm` (*type:* `String.t`, *default:* `nil`) - The password hash algorithm.
  *   `memoryCost` (*type:* `integer()`, *default:* `nil`) - Memory cost for hash calculation. Used by scrypt similar algorithms.
  *   `parallelization` (*type:* `integer()`, *default:* `nil`) - 
  *   `rounds` (*type:* `integer()`, *default:* `nil`) - Rounds for hash calculation. Used by scrypt and similar algorithms.
  *   `saltSeparator` (*type:* `String.t`, *default:* `nil`) - The salt separator.
  *   `sanityCheck` (*type:* `boolean()`, *default:* `nil`) - If true, backend will do sanity check(including duplicate email and federated id) when uploading account.
  *   `signerKey` (*type:* `String.t`, *default:* `nil`) - The key for to hash the password.
  *   `targetProjectId` (*type:* `String.t`, *default:* `nil`) - Specify which project (field value is actually project id) to operate. Only used when provided credential.
  *   `users` (*type:* `list(GoogleApi.IdentityToolkit.V3.Model.UserInfo.t)`, *default:* `nil`) - The account info to be stored.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :allowOverwrite => boolean() | nil,
          :blockSize => integer() | nil,
          :cpuMemCost => integer() | nil,
          :delegatedProjectNumber => String.t() | nil,
          :dkLen => integer() | nil,
          :hashAlgorithm => String.t() | nil,
          :memoryCost => integer() | nil,
          :parallelization => integer() | nil,
          :rounds => integer() | nil,
          :saltSeparator => String.t() | nil,
          :sanityCheck => boolean() | nil,
          :signerKey => String.t() | nil,
          :targetProjectId => String.t() | nil,
          :users => list(GoogleApi.IdentityToolkit.V3.Model.UserInfo.t()) | nil
        }

  field(:allowOverwrite)
  field(:blockSize)
  field(:cpuMemCost)
  field(:delegatedProjectNumber)
  field(:dkLen)
  field(:hashAlgorithm)
  field(:memoryCost)
  field(:parallelization)
  field(:rounds)
  field(:saltSeparator)
  field(:sanityCheck)
  field(:signerKey)
  field(:targetProjectId)
  field(:users, as: GoogleApi.IdentityToolkit.V3.Model.UserInfo, type: :list)
end

defimpl Poison.Decoder,
  for: GoogleApi.IdentityToolkit.V3.Model.IdentitytoolkitRelyingpartyUploadAccountRequest do
  def decode(value, options) do
    GoogleApi.IdentityToolkit.V3.Model.IdentitytoolkitRelyingpartyUploadAccountRequest.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.IdentityToolkit.V3.Model.IdentitytoolkitRelyingpartyUploadAccountRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
